const cloud = require("wx-server-sdk")
cloud.init()
exports.main = async (event, context) => {  
  const res = await cloud.cloudPay.unifiedOrder({
    "body" : event.body,
    "outTradeNo" : "1217752501201407033233368018",
    "spbillCreateIp" : "127.0.0.1",
    "subMchId" : "1603372049",//商户号
    "totalFee" : 1,//注意必须是数字，如果不是数字，则会报错unifiedOrder:fail wx api error: -202
    "envId": "syksjw-7g3hyzyn99912491",
    "functionName": "payCallBack",//支付回调的云函数名字
    "nonceStr":event.nonceStr,
  })
  return res
}